3.156 \(\int \frac{\cos ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\)

Optimal. Leaf size=169 \[ -\frac{i}{64 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac{5 i}{64 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}+\frac{3 x}{32 a^4}+\frac{i a}{20 d (a+i a \tan (c+d x))^5}+\frac{i}{16 d (a+i a \tan (c+d x))^4}+\frac{i}{16 a d (a+i a \tan (c+d x))^3} \]

[Out]

(3*x)/(32*a^4) + ((I/20)*a)/(d*(a + I*a*Tan[c + d*x])^5) + (I/16)/(d*(a + I*a*Tan[c + d*x])^4) + (I/16)/(a*d*(
a + I*a*Tan[c + d*x])^3) + (I/16)/(d*(a^2 + I*a^2*Tan[c + d*x])^2) - (I/64)/(d*(a^4 - I*a^4*Tan[c + d*x])) + (
(5*I)/64)/(d*(a^4 + I*a^4*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0964324, antiderivative size = 169, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3487, 44, 206} \[ -\frac{i}{64 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac{5 i}{64 d \left (a^4+i a^4 \tan (c+d x)\right )}+\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}+\frac{3 x}{32 a^4}+\frac{i a}{20 d (a+i a \tan (c+d x))^5}+\frac{i}{16 d (a+i a \tan (c+d x))^4}+\frac{i}{16 a d (a+i a \tan (c+d x))^3} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

(3*x)/(32*a^4) + ((I/20)*a)/(d*(a + I*a*Tan[c + d*x])^5) + (I/16)/(d*(a + I*a*Tan[c + d*x])^4) + (I/16)/(a*d*(
a + I*a*Tan[c + d*x])^3) + (I/16)/(d*(a^2 + I*a^2*Tan[c + d*x])^2) - (I/64)/(d*(a^4 - I*a^4*Tan[c + d*x])) + (
(5*I)/64)/(d*(a^4 + I*a^4*Tan[c + d*x]))

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\cos ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx &=-\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int \frac{1}{(a-x)^2 (a+x)^6} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int \left (\frac{1}{64 a^6 (a-x)^2}+\frac{1}{4 a^2 (a+x)^6}+\frac{1}{4 a^3 (a+x)^5}+\frac{3}{16 a^4 (a+x)^4}+\frac{1}{8 a^5 (a+x)^3}+\frac{5}{64 a^6 (a+x)^2}+\frac{3}{32 a^6 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=\frac{i a}{20 d (a+i a \tan (c+d x))^5}+\frac{i}{16 d (a+i a \tan (c+d x))^4}+\frac{i}{16 a d (a+i a \tan (c+d x))^3}+\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{i}{64 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac{5 i}{64 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{(3 i) \operatorname{Subst}\left (\int \frac{1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{32 a^3 d}\\ &=\frac{3 x}{32 a^4}+\frac{i a}{20 d (a+i a \tan (c+d x))^5}+\frac{i}{16 d (a+i a \tan (c+d x))^4}+\frac{i}{16 a d (a+i a \tan (c+d x))^3}+\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{i}{64 d \left (a^4-i a^4 \tan (c+d x)\right )}+\frac{5 i}{64 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.253351, size = 120, normalized size = 0.71 \[ \frac{\sec ^4(c+d x) (-100 \sin (2 (c+d x))+120 i d x \sin (4 (c+d x))+15 \sin (4 (c+d x))+12 \sin (6 (c+d x))+200 i \cos (2 (c+d x))+15 (8 d x+i) \cos (4 (c+d x))-8 i \cos (6 (c+d x))+100 i)}{1280 a^4 d (\tan (c+d x)-i)^4} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

(Sec[c + d*x]^4*(100*I + (200*I)*Cos[2*(c + d*x)] + 15*(I + 8*d*x)*Cos[4*(c + d*x)] - (8*I)*Cos[6*(c + d*x)] -
 100*Sin[2*(c + d*x)] + 15*Sin[4*(c + d*x)] + (120*I)*d*x*Sin[4*(c + d*x)] + 12*Sin[6*(c + d*x)]))/(1280*a^4*d
*(-I + Tan[c + d*x])^4)

________________________________________________________________________________________

Maple [A]  time = 0.103, size = 156, normalized size = 0.9 \begin{align*}{\frac{-{\frac{3\,i}{64}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{{a}^{4}d}}+{\frac{{\frac{i}{16}}}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}-{\frac{{\frac{i}{16}}}{{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}+{\frac{1}{20\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{5}}}-{\frac{1}{16\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}+{\frac{5}{64\,{a}^{4}d \left ( \tan \left ( dx+c \right ) -i \right ) }}+{\frac{{\frac{3\,i}{64}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{{a}^{4}d}}+{\frac{1}{64\,{a}^{4}d \left ( \tan \left ( dx+c \right ) +i \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x)

[Out]

-3/64*I/d/a^4*ln(tan(d*x+c)-I)+1/16*I/d/a^4/(tan(d*x+c)-I)^4-1/16*I/d/a^4/(tan(d*x+c)-I)^2+1/20/d/a^4/(tan(d*x
+c)-I)^5-1/16/d/a^4/(tan(d*x+c)-I)^3+5/64/d/a^4/(tan(d*x+c)-I)+3/64*I/d/a^4*ln(tan(d*x+c)+I)+1/64/d/a^4/(tan(d
*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.35943, size = 292, normalized size = 1.73 \begin{align*} \frac{{\left (120 \, d x e^{\left (10 i \, d x + 10 i \, c\right )} - 10 i \, e^{\left (12 i \, d x + 12 i \, c\right )} + 150 i \, e^{\left (8 i \, d x + 8 i \, c\right )} + 100 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 50 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 15 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )} e^{\left (-10 i \, d x - 10 i \, c\right )}}{1280 \, a^{4} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

1/1280*(120*d*x*e^(10*I*d*x + 10*I*c) - 10*I*e^(12*I*d*x + 12*I*c) + 150*I*e^(8*I*d*x + 8*I*c) + 100*I*e^(6*I*
d*x + 6*I*c) + 50*I*e^(4*I*d*x + 4*I*c) + 15*I*e^(2*I*d*x + 2*I*c) + 2*I)*e^(-10*I*d*x - 10*I*c)/(a^4*d)

________________________________________________________________________________________

Sympy [A]  time = 1.23209, size = 260, normalized size = 1.54 \begin{align*} \begin{cases} \frac{\left (- 171798691840 i a^{20} d^{5} e^{32 i c} e^{2 i d x} + 2576980377600 i a^{20} d^{5} e^{28 i c} e^{- 2 i d x} + 1717986918400 i a^{20} d^{5} e^{26 i c} e^{- 4 i d x} + 858993459200 i a^{20} d^{5} e^{24 i c} e^{- 6 i d x} + 257698037760 i a^{20} d^{5} e^{22 i c} e^{- 8 i d x} + 34359738368 i a^{20} d^{5} e^{20 i c} e^{- 10 i d x}\right ) e^{- 30 i c}}{21990232555520 a^{24} d^{6}} & \text{for}\: 21990232555520 a^{24} d^{6} e^{30 i c} \neq 0 \\x \left (\frac{\left (e^{12 i c} + 6 e^{10 i c} + 15 e^{8 i c} + 20 e^{6 i c} + 15 e^{4 i c} + 6 e^{2 i c} + 1\right ) e^{- 10 i c}}{64 a^{4}} - \frac{3}{32 a^{4}}\right ) & \text{otherwise} \end{cases} + \frac{3 x}{32 a^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2/(a+I*a*tan(d*x+c))**4,x)

[Out]

Piecewise(((-171798691840*I*a**20*d**5*exp(32*I*c)*exp(2*I*d*x) + 2576980377600*I*a**20*d**5*exp(28*I*c)*exp(-
2*I*d*x) + 1717986918400*I*a**20*d**5*exp(26*I*c)*exp(-4*I*d*x) + 858993459200*I*a**20*d**5*exp(24*I*c)*exp(-6
*I*d*x) + 257698037760*I*a**20*d**5*exp(22*I*c)*exp(-8*I*d*x) + 34359738368*I*a**20*d**5*exp(20*I*c)*exp(-10*I
*d*x))*exp(-30*I*c)/(21990232555520*a**24*d**6), Ne(21990232555520*a**24*d**6*exp(30*I*c), 0)), (x*((exp(12*I*
c) + 6*exp(10*I*c) + 15*exp(8*I*c) + 20*exp(6*I*c) + 15*exp(4*I*c) + 6*exp(2*I*c) + 1)*exp(-10*I*c)/(64*a**4)
- 3/(32*a**4)), True)) + 3*x/(32*a**4)

________________________________________________________________________________________

Giac [A]  time = 1.14504, size = 166, normalized size = 0.98 \begin{align*} -\frac{-\frac{60 i \, \log \left (\tan \left (d x + c\right ) + i\right )}{a^{4}} + \frac{60 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{4}} + \frac{20 \,{\left (3 i \, \tan \left (d x + c\right ) - 4\right )}}{a^{4}{\left (\tan \left (d x + c\right ) + i\right )}} + \frac{-137 i \, \tan \left (d x + c\right )^{5} - 785 \, \tan \left (d x + c\right )^{4} + 1850 i \, \tan \left (d x + c\right )^{3} + 2290 \, \tan \left (d x + c\right )^{2} - 1565 i \, \tan \left (d x + c\right ) - 541}{a^{4}{\left (\tan \left (d x + c\right ) - i\right )}^{5}}}{1280 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

-1/1280*(-60*I*log(tan(d*x + c) + I)/a^4 + 60*I*log(tan(d*x + c) - I)/a^4 + 20*(3*I*tan(d*x + c) - 4)/(a^4*(ta
n(d*x + c) + I)) + (-137*I*tan(d*x + c)^5 - 785*tan(d*x + c)^4 + 1850*I*tan(d*x + c)^3 + 2290*tan(d*x + c)^2 -
 1565*I*tan(d*x + c) - 541)/(a^4*(tan(d*x + c) - I)^5))/d